+Sun Jul 12 05:59:26 1998 Tim Janik <timj@gtk.org>
+
+ * gtk/gtktypeutils.c (gtk_type_new): call the base classes'
+ object_init_func for derived objects with the object's ->klass field
+ still pointing to the corresponding base class, otherwise overridden
+ class functions could get called with partly-initialized objects.
+ (change from Tero Pulkkinen <terop@modeemi.cs.tut.fi>).
+
Sun Jul 12 02:47:35 1998 Tim Janik <timj@gtk.org>
* gtk/gtkobject.h:
+Sun Jul 12 05:59:26 1998 Tim Janik <timj@gtk.org>
+
+ * gtk/gtktypeutils.c (gtk_type_new): call the base classes'
+ object_init_func for derived objects with the object's ->klass field
+ still pointing to the corresponding base class, otherwise overridden
+ class functions could get called with partly-initialized objects.
+ (change from Tero Pulkkinen <terop@modeemi.cs.tut.fi>).
+
Sun Jul 12 02:47:35 1998 Tim Janik <timj@gtk.org>
* gtk/gtkobject.h:
+Sun Jul 12 05:59:26 1998 Tim Janik <timj@gtk.org>
+
+ * gtk/gtktypeutils.c (gtk_type_new): call the base classes'
+ object_init_func for derived objects with the object's ->klass field
+ still pointing to the corresponding base class, otherwise overridden
+ class functions could get called with partly-initialized objects.
+ (change from Tero Pulkkinen <terop@modeemi.cs.tut.fi>).
+
Sun Jul 12 02:47:35 1998 Tim Janik <timj@gtk.org>
* gtk/gtkobject.h:
+Sun Jul 12 05:59:26 1998 Tim Janik <timj@gtk.org>
+
+ * gtk/gtktypeutils.c (gtk_type_new): call the base classes'
+ object_init_func for derived objects with the object's ->klass field
+ still pointing to the corresponding base class, otherwise overridden
+ class functions could get called with partly-initialized objects.
+ (change from Tero Pulkkinen <terop@modeemi.cs.tut.fi>).
+
Sun Jul 12 02:47:35 1998 Tim Janik <timj@gtk.org>
* gtk/gtkobject.h:
+Sun Jul 12 05:59:26 1998 Tim Janik <timj@gtk.org>
+
+ * gtk/gtktypeutils.c (gtk_type_new): call the base classes'
+ object_init_func for derived objects with the object's ->klass field
+ still pointing to the corresponding base class, otherwise overridden
+ class functions could get called with partly-initialized objects.
+ (change from Tero Pulkkinen <terop@modeemi.cs.tut.fi>).
+
Sun Jul 12 02:47:35 1998 Tim Janik <timj@gtk.org>
* gtk/gtkobject.h:
+Sun Jul 12 05:59:26 1998 Tim Janik <timj@gtk.org>
+
+ * gtk/gtktypeutils.c (gtk_type_new): call the base classes'
+ object_init_func for derived objects with the object's ->klass field
+ still pointing to the corresponding base class, otherwise overridden
+ class functions could get called with partly-initialized objects.
+ (change from Tero Pulkkinen <terop@modeemi.cs.tut.fi>).
+
Sun Jul 12 02:47:35 1998 Tim Janik <timj@gtk.org>
* gtk/gtkobject.h:
+Sun Jul 12 05:59:26 1998 Tim Janik <timj@gtk.org>
+
+ * gtk/gtktypeutils.c (gtk_type_new): call the base classes'
+ object_init_func for derived objects with the object's ->klass field
+ still pointing to the corresponding base class, otherwise overridden
+ class functions could get called with partly-initialized objects.
+ (change from Tero Pulkkinen <terop@modeemi.cs.tut.fi>).
+
Sun Jul 12 02:47:35 1998 Tim Janik <timj@gtk.org>
* gtk/gtkobject.h:
}
else
object = g_malloc0 (node->type_info.object_size);
- object->klass = klass;
+ /* we need to call the base classes' object_init_func for derived
+ * objects with the object's ->klass field still pointing to the
+ * corresponding base class, otherwise overridden class functions
+ * could get called with partly-initialized objects.
+ */
for (i = node->n_supers; i > 0; i--)
{
GtkTypeNode *pnode;
LOOKUP_TYPE_NODE (pnode, node->supers[i]);
if (pnode->type_info.object_init_func)
- (* pnode->type_info.object_init_func) (object);
+ {
+ object->klass = pnode->klass;
+ pnode->type_info.object_init_func (object);
+ }
}
+ object->klass = klass;
if (node->type_info.object_init_func)
- (* node->type_info.object_init_func) (object);
+ node->type_info.object_init_func (object);
return object;
}